﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DivisibleNumbers
{
    class DivisibleNumbers
    {
        static void Main(string[] args)
        {
            int[] array = {1, 2, 5, 9, 21, 63, 131, 4124};
            List<int> numbers = new List<int>(array);
            var res1 = numbers.FindAll(number => number % 3 == 0 && number % 7 == 0);
            foreach (var number in res1)
            {
                Console.WriteLine(number);
            }

            var res2 =
               from number in numbers
               where number % 3 == 0 && number % 7 == 0
               select number;

            Console.WriteLine();
            foreach (var number in res2)
            {
                Console.WriteLine(number);
            }

            var res3 =
               from number in array
               where number % 3 == 0 && number % 7 == 0
               select number;
            Console.WriteLine();
            foreach (var number in res3)
            {
                Console.WriteLine(number);                
            }

            Console.WriteLine();
            var res4 = Array.FindAll(array, (number => number % 3 == 0 && number % 7 == 0));
            foreach (var number in res4)
            {
                Console.WriteLine(number);
            }

        }
    }
}
